<?php

/**
 * @author Sanches
 * @copyright 2008
 * @RSi php5
 */

class RSi
{
	public $RSi;
	public $Time;
	private $S;
	private $E;
	private $Size;
	
	private function getmicrotime() 
	{ 
    	list($usec, $sec) = explode(" ", microtime()); 
    	return ((float)$usec + (float)$sec); 
	}
 	
 	public function RSi_stop()
	{
		$this->Size = ob_get_length();
		ob_flush();
		$this->E = $this->getmicrotime(1);
		$this->RSi = round(($this->Size /($this->E - $this->S))/1024,2);
		$this->Time = round($this->E - $this->S,3);
	}
 	
 	public function RSi_start()
 	{
		$this->S = $this->getmicrotime(1);
		ob_start();
	}
	
	
};

$RSi = new RSi();
?>